Skip to content

Conversation

@MorganSandercock
Copy link

Change the type for reading length to size_t so that more than 255 bytes can be read in one operation. (Writing more than 255 is a little more complex due to the small (usually 32 byte) buffer used inside the Wire.h library.)

The underlying I2C and SPI libraries use size_t for the size of reads and writes, so why does the BusIO have this limit? Yes, it's pretty rare to read this much but there are some devices where this is a limitation on the use of the device. This commit also updates some of the Docygen comments on the read/write functions to make it clear when the maxbuffersize() applies.

Change the type for reading length to size_t so that more than 255 bytes can be read in one operation. (Writing more than 255 is a little more complex due to the small (usually 32 byte) buffer used inside the Wire.h library.)
The Teensy LC, 3.x and 4.x have their own implementation of the TwoWire object. This has an internal buffer much bigger than the default 32 bytes expected by this library. This change will allow whatever is declared by the Teensy library to be used as the real buffer size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant